<%-- 
    Document   : login
    Created on : 19/05/2010, 22:17:19
    Author     : marcelo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Guia Terminal Rodoviário</title>
        <style type="text/css">
            @import url("../add/css/cssAdmin.css");
            @import url("../add/css/rodape.css");
        </style>
        <script type="text/javascript">
            function verifyFields(){
                var txtLogin = document.getElementById("login");
                var txtPassword = document.getElementById("pwd");
                document.getElementById('validate').innerHTML = '';
                document.getElementById('validate1').innerHTML = '';
                var fill = true;
                if(txtLogin.value==""){
                    document.getElementById('validate').innerHTML = 'Informe o login';
                    fill=false;
                }
                if(txtPassword.value==""){
                    document.getElementById('validate1').innerHTML = 'Informe a senha';
                    fill=false;
                }
                if(fill==false)
                    return;
                document.getElementById("form").submit();
            }
            function keyPress(event){
                var keyNum;
                if(window.event){
                    keyNum=event.keyCode;
                }else if(event.which){
                    keyNum=event.which;
                }
                if(event.keyCode == 13){
                    verifyFields();
                }
            }
            function focus(){
                document.getElementById("login").focus();
            }
        </script>
    </head>
    <body onload="javascript:focus();">
        <div class="geral">
            <table>
                <tr>
                    <td>
                        <div id="cabecalho"></div>
                    </td>
                </tr>
            </table>
            <br>
            <form id="form" method="post" action="../AutenticaServlet">
                <input type="hidden" name="module" value="administration"/>
                <div align="right"><b style="color:red">(*) campos obrigatórios</b></div>
                <table>
                    <tr>
                        <td class="label_bg" style="width:100px;">&nbsp;&nbsp;Usuário:</td>
                        <td><input type="text" maxlength="100" size="40" id="login" name="login" onkeypress="keyPress(event);"/> <b style="color:red">*</b> <b id="validate"></b></td>
                    </tr>

                    <tr>
                        <td class="label_bg" style="width:100px;">&nbsp;&nbsp;Senha:</td>
                        <td><input type="password" maxlength="100" size="40" id="pwd" name="pwd" onkeypress="keyPress(event);"/> <b style="color:red">*</b> <b id="validate1"></b></td>
                    </tr>
                    <tr>                       
                        <td colspan="2" align="center"><b id="validate2"></b></td>
                    </tr>
                    <%
                        if(request.getParameter("erro") != null && request.getParameter("erro").equals("1")){%>
                            <script type="text/javascript">
                                document.getElementById('validate2').innerHTML = 'Usuário ou senha inválidos!';
                            </script>
                        <%}
                    %>
                </table>
                <table>
                    <tr>
                        <td colspan="2" align="right" width="375"><input type="button" onclick="javascript:verifyFields();" name="Entrar" value="Entrar"/></td>
                    </tr>
                </table>
            </form>
            <br>
            <table id="rodape" style="background-image:url(../add/images/rodape.png);">
                <tr>
                </tr>
            </table>
            <table id="btRodape" style="text-decoration: none;" >
                <tr>
                    <td align="center" width="80px">
                        <ul class="btYoutube">
                            <li><a title="Youtube" href="http://www.youtube.com" /></li>
                        </ul>
                    </td >
                    <td align="center" width="80px">
                        <ul class="btOrkut">
                            <li><a title="Orkut" href="http://www.orkut.com" /></li>
                        </ul>
                    </td>
                    <td align="center" width="205px">
                        <ul class="btTwitter">
                            <li><a title="Twitter" href="http://twitter.com" /></li>
                        </ul>
                    </td>
                    <td align="center">
                        <a title="Trabalhe Conosco" class="text" href="../Carrer.jsp" >Trabalhe Conosco</a>
                    </td>
                    <td align="center"  width="">
                        <a title="Mapa do Site" class="text" href="../SiteMap.jsp">Mapa do Site</a>
                    </td>
                    <td align="center" width="">
                        <a title="Contatos" class="text" href="../Contact.jsp">Contatos</a>
                    </td>
                </tr>
            </table>

        </div>
    </body>
</html>
